function gets(pageNum) {
    var m=$("#dinumber").val();
    var l=$("#cname").val();
    var k=$("#jixing").val();
    var j=$("#guige").val();
    var i=$("#danwei").val();
    var h=$("#cc").val();
    var g=$("#qiye").val();
    var f=$("#shangpin").val();
    var e=$("#lefPprice").val();
    var d=$("#rightPrice").val();
    var c=$("#cengci").val();
    var b=$("#dcid").val();
    var a=$("#state").val();
    var pageN = pageNum;
    $.ajax({
            url: '/myspringboot/suppliser/findDISdi',
            type: 'post',
            dataType: "json",
            data:{
                dinumber:m,
                cname:l,
                jixing:k,
                guige:j,
                danwei:i,
                cc:h,
                qiye:g,
                shangpin:f,
                lefPprice:e,
                rightPrice:d,
                cengci:c,
                leibie:b,
                state:a,
                pageNum:pageN,
            },
        success:function(result){
            var result = result.data;
            yibu(result.pages,result.pageNum);
            var list = result.list;
            $(".a").empty();
            for (var i = 0; i < list.length; i++){
                    var aa =1+i;
                    var diId = list[i].diId;
                    //药品流水号
                    var daNumber = list[i].diNumer;
                    //通用名
                    var diName = list[i].diName;
                    //剂型
                    var diForm = list[i].diForm;
                    //规格
                    var diSpecifications = list[i].diSpecifications;
                    //单位
                    var diUnit = list[i].diUnit;
                    //装换系数
                    var diCc = list[i].diCc;
                    //生产企业
                    var daSupplier=null;
                    var daName=null;
                    var drugAtegory = list[i].drugAtegory;
                    if (drugAtegory ==null) {
                        daSupplier="null"
                        daName="null"
                    }else {
                        daSupplier = list[i].drugAtegory.daSupplier;
                        //商品名称
                        daName = list[i].drugAtegory.daName;
                    }
                    //中间jia
                    var diNewPrice = list[i].diNewPrice;
                    //质量层次
                var dqlName=null
                if (list[i].drugQualityLevel==null){
                    dqlName="null"
                } else {
                    dqlName = list[i].drugQualityLevel.dqlName;
                }

                    //药品类别
                    var dcName = list[i].drugCategory.dcName;
                    //交易状态
                    var diTradingStatus = list[i].diTradingStatus;
                    var a="";
                    if (diTradingStatus==0){
                         a = "未交易";
                    } else {
                         a= "交易完成"
                    }
                var $tr = '<tr>'+
                    '<td>'+aa+'</td>'+
                    '<td><input class="selectItem1" name="sdiId" value='+diId+' type="checkbox">' +
                    '<input class="selectItem2" name="sdiSId" type="hidden" value='+"1"+'></td>'+
                    '<td>'+daNumber+'</td>'+
                    '<td>'+diName+'</td>'+
                    '<td>'+diForm+'</td>'+
                    '<td>'+diSpecifications+'</td>'+
                    '<td>'+diUnit+'</td>'+
                    '<td>'+diCc+'</td>'+
                    '<td>'+daSupplier+'</td>'+
                    '<td>'+daName+'</td>'+
                    '<td>'+diNewPrice+'</td>'+
                    '<td>'+dqlName+'</td>'+
                    '<td>'+dcName+'</td>'+
                    '<td>'+a+'</td>'+
                    '<td>'+'<button id="btn_re" data-toggle="modal"onclick="findOne('+diId+')" data-target="#myModal">查看</button>'+'</td>'+
                    '</tr>'
                $(".a").append($tr);
            }
        }
        }
    )
}

//全选
function selectAll(obj) {
    var checkboxEle = document.getElementsByClassName("selectItem1");
    for(var i = 0; i < checkboxEle.length; i++) {
        checkboxEle[i].checked = obj.checked;
    }
}
//获取复选框的值
function show(){
    obj1 = document.getElementsByClassName("selectItem1");
    var sdiI= [];
    for(k in obj1){
        if(obj1[k].checked)
            sdiI.push(obj1[k].value);
    }
    $.ajax({
        url:'/myspringboot/CommodityController/addSdi',
        type: 'post',
        dataType:'json',
        traditional:true,
        data:{
            sdiId:sdiI,
        },
        success:function (result) {
            alert(result.msg)
            window.location.href="../../../../main.html";
        }
    })
}